﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>
    <div>
        <form id="form">
            @Html.CreateQueryInfo(new QueryTextBox("Name")
                {
                    QueryTitle = "QueryInfo1",
                    QueryValue = "查询值"
                })
            @Html.CreateQueryInfo(new QueryTextBox("Age", QueryBoxType.NumberBox)
                {
                    QueryTitle = "QueryInfo2",
                    QueryValue = "18"
                })
            <br />
            @Html.CreateQueryInfo(new QueryTextBox("Date", QueryBoxType.DateTimeBox)
                {
                    Id = "QueryID3",
                    QueryTitle = "QueryInfo3",
                })
            -
            @Html.CreateQueryInfo(new QueryTextBox("Date", QueryBoxType.DateTimeBox)
                {
                    Id = "QueryID4",
                    QueryTitle = "QueryInfo4",
                    QueryMethod = QueryMethod.LessEqual,
                    QueryValue = DateTime.Now.ToString()
                })
            <br />
            @Html.CreateQueryInfo(new QueryDropDownList("Sex",
                    new List<SelectListItem> 
                    {
                        new SelectListItem{Text="==全部=="},
                        new SelectListItem{Text="男",Value="0"},
                        new SelectListItem{Text="女",Value="1"}
                    })
                {
                    QueryTitle = "QueryInfo5",
                })
            @Html.CreateQueryInfo(new QueryCheckbox("IsVip", "1", "0")
                {
                    Id = "QueryID6",
                    QueryTitle = "QueryInfo6"
                })
            <br />
            @Html.CreateQueryInfo(new QueryInfo("QueryInfoID") { QueryField = "Id", QueryValue = "100", QueryDataType = QueryDataType.Int, QueryMethod = QueryMethod.Equal })
            <input type="button" id="btn_submit" value="提交" />
            <p>
                查询条件：<span id="condition"></span>
            </p>
        </form>
    </div>
    <script src="~/Content/js/jquery-1.8.2.js"></script>
    <script src="~/Content/js/tjzheng.js"></script>
    <script type="text/javascript">
        $("#btn_submit").click(function () {
            var objFormEntity = new FormEntity("#form");
            objFormEntity.url = "/Query/QueryTest";
            objFormEntity.submitSuccess = function (InvokeResult) {
                $("#condition").html(InvokeResult);
            };
            objFormEntity.isClearData = false;
            objFormEntity.submit();
        });
    </script>
</body>
</html>
